package cn.tank.data.sync.server.redis;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.scheduling.annotation.Scheduled;
import org.springframework.stereotype.Component;

/************************************************
 * @Description:测试消息发送定时器任务类，模拟数据源数据变更
 * @Version: 1.0
 ************************************************/
@Component
public class SendMessageTask{

    private static final Logger log = LoggerFactory.getLogger(SendMessageTask.class);

    @Autowired
    private MessageSendTest messageSendTest;

    @Scheduled(cron = "0/10 * * * * ? ")
    private void clearFlowLog() throws InterruptedException{

        log.info("*******************************************");
        log.info("定时任务开始模拟发送事件数据");

        messageSendTest.write("测试写入数据");
        Thread.sleep(1000);

        messageSendTest.update("测试更新数据");
        Thread.sleep(1000);

        messageSendTest.delete("测试删除数据");
        Thread.sleep(1000);

        messageSendTest.refresh("测试刷新数据");
    }

}
